package com.wicket.okrapp.base.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.wicket.okrapp.base.service.MOmsTspeCycleStageDataService;
import com.wicket.okrapp.base.service.dto.req.*;
import com.wicket.okrapp.common.dto.FieldInfo;
import com.wicket.okrapp.common.exception.BizException;
import com.wicket.okrapp.common.util.CommonFunctionHelper;
import com.wicket.okrapp.dal.mapper.mbg.OmsTspeCycleStageDataMapper;
import com.wicket.okrapp.dal.po.mbg.OmsTspeCycleStageData;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author ：
 * @since 2022/1/19 15:39
 *
 *
 * @version 1.0
 */
@Service
public class MOmsTspeCycleStageDataServiceImpl
        extends ServiceImpl<OmsTspeCycleStageDataMapper, OmsTspeCycleStageData>
        implements MOmsTspeCycleStageDataService {

    @Autowired
    OmsTspeCycleStageDataMapper omsTspeCycleStageDataMapper;

    /**
   * 3-3-11批量查周期阶段资料[2778]
   * gen by moon at 10/15/2022, 10:04:36 PM
   */
 @Trace(operationName = "3-3-11批量查周期阶段资料")
 @Tags({@Tag(key = "参数",value = "arg[0]"),
 @Tag(key = "返回值",value = "returnedObj")})
  @Override
  @Transactional(rollbackFor=Exception.class)
  public  List<OmsTspeCycleStageData>  batchQueryCycleStageData(BatchQueryCycleStageDataReq reqDto) {
     
        try {
            QueryWrapper<OmsTspeCycleStageData> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            if(reqDto.getCycleStageDataList()==null || reqDto.getCycleStageDataList().isEmpty()){
                    return new ArrayList<>();
                }
        queryWrapper.in("cycle_stage_data_id", reqDto.getCycleStageDataList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsTspeCycleStageData.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsTspeCycleStageData.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper,likeList,fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap,likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsTspeCycleStageData.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            
            return ((List<OmsTspeCycleStageData>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1",e,false);
        }
  }

    /**
   * 3-3-11查周期阶段资料详情[2771]
   * gen by moon at 3/30/2023, 12:39:15 PM
   */
 @Trace(operationName = "3-3-11查周期阶段资料详情")
 @Tags({@Tag(key = "参数",value = "arg[0]"),
 @Tag(key = "返回值",value = "returnedObj")})
  @Override
  @Transactional(rollbackFor=Exception.class)
  public  OmsTspeCycleStageData  queryCycleStageDataDetail(QueryCycleStageDataDetailReq reqDto) {
     
        try {
         reqDto.setIsValid("FALSE");
            QueryWrapper<OmsTspeCycleStageData> queryWrapper = new QueryWrapper<>();
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsTspeCycleStageData> retList = super.list(queryWrapper);
            if(retList!=null && retList.size()>0){
                OmsTspeCycleStageData retData = retList.get(0);
                
                return retData;
            }
            return null;
      } catch (Exception e) {
          e.printStackTrace();
          throw new BizException("-1",e,false);
      }
  }

    /**
   * 3-3-11修改周期阶段资料[2704]
   * gen by moon at 10/15/2022, 10:04:30 PM
   */
 @Trace(operationName = "3-3-11修改周期阶段资料")
 @Tags({@Tag(key = "参数",value = "arg[0]"),
 @Tag(key = "返回值",value = "returnedObj")})
  @Override
  @Transactional(rollbackFor=Exception.class)
  public  boolean  updateCycleStageData(OmsTspeCycleStageData omsTspeCycleStageData) {
     omsTspeCycleStageData.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
omsTspeCycleStageData.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        return super.updateById(omsTspeCycleStageData);
  }

    /**
   * 3-3-11查询周期阶段资料列表[2673]
   * gen by moon at 10/15/2022, 10:04:29 PM
   */
 @Trace(operationName = "3-3-11查询周期阶段资料列表")
 @Tags({@Tag(key = "参数",value = "arg[0]"),
 @Tag(key = "返回值",value = "returnedObj")})
  @Override
  @Transactional(rollbackFor=Exception.class)
  public  List<OmsTspeCycleStageData>  queryCycleStageDataList(QueryCycleStageDataListReq reqDto) {
     
        try {
            QueryWrapper<OmsTspeCycleStageData> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsTspeCycleStageData.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsTspeCycleStageData.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper,likeList,fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap,likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsTspeCycleStageData.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            queryWrapper.orderByDesc("operate_time");
            return ((List<OmsTspeCycleStageData>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1",e,false);
        }
  }

    /**
   * 3-3-11新增周期阶段资料[2420]
   * gen by moon at 1/4/2024, 3:01:28 PM
   */
 @Trace(operationName = "3-3-11新增周期阶段资料")
 @Tags({@Tag(key = "参数",value = "arg[0]"),
 @Tag(key = "返回值",value = "returnedObj")})
  @Override
  @Transactional(rollbackFor=Exception.class)
  public  String  addCycleStageData(OmsTspeCycleStageData omsTspeCycleStageData) {
     omsTspeCycleStageData.setCycleStageDataId(CommonFunctionHelper.getUid());//DISTRIBUTED_ID
omsTspeCycleStageData.setIsArchive("FALSE");
omsTspeCycleStageData.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
omsTspeCycleStageData.setCreateInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
omsTspeCycleStageData.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
omsTspeCycleStageData.setCreateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
omsTspeCycleStageData.setIsValid("FALSE");
omsTspeCycleStageData.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
omsTspeCycleStageData.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
     if(super.save(omsTspeCycleStageData)){
        return omsTspeCycleStageData.getCycleStageDataId();
     }else {
        return "-1";
     }
    
  }
/**
   * 3-3-11批量修改周期阶段资料[3342]
   * gen by moon at 4/13/2023, 3:38:46 PM
   */
 @Trace(operationName = "3-3-11批量修改周期阶段资料")
 @Tags({@Tag(key = "参数",value = "arg[0]"),
 @Tag(key = "返回值",value = "returnedObj")})
  @Override
  @Transactional(rollbackFor=Exception.class)
  public  boolean  batchUpdateCycleStageData(List<OmsTspeCycleStageData> omsTspeCycleStageData) {
     
      if(omsTspeCycleStageData==null || omsTspeCycleStageData.size()==0){
        return false;
      }
        return super.saveOrUpdateBatch(omsTspeCycleStageData);
      
  }
/**
   * 3-3-11批量删周期阶段资料[4220]
   * gen by moon at 10/15/2022, 10:04:37 PM
   */
 @Trace(operationName = "3-3-11批量删周期阶段资料")
 @Tags({@Tag(key = "参数",value = "arg[0]"),
 @Tag(key = "返回值",value = "returnedObj")})
  @Override
  @Transactional(rollbackFor=Exception.class)
  public  boolean  batchDeleteCycleStageData(List<String> reqDto) {
     
          if(reqDto==null || reqDto.size()==0){
            return false;
          }
          
          return super.removeByIds(reqDto);
  }
/**
   * 3-3-11批量查询周期阶段资料列表ByIds[4225]
   * gen by moon at 2/16/2023, 9:50:57 PM
   */
 @Trace(operationName = "3-3-11批量查询周期阶段资料列表ByIds")
 @Tags({@Tag(key = "参数",value = "arg[0]"),
 @Tag(key = "返回值",value = "returnedObj")})
  @Override
  @Transactional(rollbackFor=Exception.class)
  public  List<OmsTspeCycleStageData>  batchQueryCycleStageDataListByIds(BatchQueryCycleStageDataListByIdsReq reqDto) {
     
        try {
            QueryWrapper<OmsTspeCycleStageData> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            if(reqDto.getCycleStageDataList()==null || reqDto.getCycleStageDataList().isEmpty()){
                    return new ArrayList<>();
                }
        queryWrapper.in("cycle_data_obj_id", reqDto.getCycleStageDataList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsTspeCycleStageData.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsTspeCycleStageData.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper,likeList,fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap,likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsTspeCycleStageData.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            
            return ((List<OmsTspeCycleStageData>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1",e,false);
        }
  }
/**
   * M3-3-07新增执行周期阶段资料[4301]
   * gen by moon at 10/15/2022, 10:04:39 PM
   */
 @Trace(operationName = "M3-3-07新增执行周期阶段资料")
 @Tags({@Tag(key = "参数",value = "arg[0]"),
 @Tag(key = "返回值",value = "returnedObj")})
  @Override
  @Transactional(rollbackFor=Exception.class)
  public  String  addExecuteCycleStageDoc(OmsTspeCycleStageData omsTspeCycleStageData) {
     omsTspeCycleStageData.setCycleStageDataId(CommonFunctionHelper.getUid());//DISTRIBUTED_ID
omsTspeCycleStageData.setCycleDataTypeCode("CYC_STA_DAT");
omsTspeCycleStageData.setStageContentType("STA_WOR_SUM_CON");
omsTspeCycleStageData.setIsInputData("TRUE");
omsTspeCycleStageData.setCyclePurposeTypeCode("OBS_TAR_REP");
omsTspeCycleStageData.setCycleDataObjTypeCode("EVA_OBJ_TARGET_CYCLE");
omsTspeCycleStageData.setSubjectLifeCycle("CURRENTLY_VALID");
omsTspeCycleStageData.setIsArchive("FALSE");
omsTspeCycleStageData.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
omsTspeCycleStageData.setCreateInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
if(omsTspeCycleStageData!=null && omsTspeCycleStageData.getSubjectLifeCycle()!=null &&  omsTspeCycleStageData.getSubjectLifeCycle().equals("CURRENTLY_VALID")) {
            omsTspeCycleStageData.setReleaseInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//RELEASED_CURRENT_INDUCTIONID
          }
omsTspeCycleStageData.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
omsTspeCycleStageData.setCreateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
if(omsTspeCycleStageData!=null && omsTspeCycleStageData.getSubjectLifeCycle()!=null && omsTspeCycleStageData.getSubjectLifeCycle().equals("ARCHIVING")) {
              omsTspeCycleStageData.setReleaseTime(CommonFunctionHelper.getCurrentTime());//HISTORICAL_ARCHIVING
          }
omsTspeCycleStageData.setIsValid("FALSE");
omsTspeCycleStageData.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
omsTspeCycleStageData.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
     if(super.save(omsTspeCycleStageData)){
        return omsTspeCycleStageData.getCycleStageDataId();
     }else {
        return "-1";
     }
    
  }
/**
   * M3-3-11一键删除周期阶段资料测试验证数据[4435]
   * gen by moon at 10/15/2022, 10:04:39 PM
   */
 @Trace(operationName = "M3-3-11一键删除周期阶段资料测试验证数据")
 @Tags({@Tag(key = "参数",value = "arg[0]"),
 @Tag(key = "返回值",value = "returnedObj")})
  @Override
  @Transactional(rollbackFor=Exception.class)
  public  boolean  autoDeleteCycleStageDataTest(List<String> reqDto) {
     
          if(reqDto==null || reqDto.size()==0){
            return false;
          }
          
          return super.removeByIds(reqDto);
  }
/**
   * M3-3-11查询周期阶段资料测试列表[4461]
   * gen by moon at 10/15/2022, 10:04:40 PM
   */
 @Trace(operationName = "M3-3-11查询周期阶段资料测试列表")
 @Tags({@Tag(key = "参数",value = "arg[0]"),
 @Tag(key = "返回值",value = "returnedObj")})
  @Override
  @Transactional(rollbackFor=Exception.class)
  public  List<OmsTspeCycleStageData>  queryCycleStageDataTestList(QueryCycleStageDataTestListReq reqDto) {
     
        try {
            QueryWrapper<OmsTspeCycleStageData> queryWrapper = new QueryWrapper<>();
            
            
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsTspeCycleStageData.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsTspeCycleStageData.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper,likeList,fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap,likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsTspeCycleStageData.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            
            return ((List<OmsTspeCycleStageData>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1",e,false);
        }
  }
/**
   * 3-3-11查询周期阶段资料列表by时间范围[6276]
   * gen by moon at 9/28/2024, 10:02:40 PM
   */
 @Trace(operationName = "3-3-11查询周期阶段资料列表by时间范围")
 @Tags({@Tag(key = "参数",value = "arg[0]"),
 @Tag(key = "返回值",value = "returnedObj")})
  @Override
  @Transactional(rollbackFor=Exception.class)
  public  List<OmsTspeCycleStageData>  queryCycleStageDataByTimeRangeList(QueryCycleStageDataByTimeRangeListReq reqDto) {

        try {
            QueryWrapper<OmsTspeCycleStageData> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID

            if(reqDto.getCycleEndTime()!=null){
                queryWrapper.le("cycle_end_time",reqDto.getCycleEndTime());
                reqDto.setCycleEndTime(null);
            }

            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsTspeCycleStageData.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsTspeCycleStageData.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper,likeList,fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap,likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsTspeCycleStageData.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            queryWrapper.orderByDesc("create_time");
queryWrapper.orderByDesc("operate_time");
            return ((List<OmsTspeCycleStageData>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1",e,false);
        }
  }
/**
   * 3-3-11批量查询周期阶段资料by周期[7158]
   * gen by moon at 6/7/2023, 7:43:05 PM
   */
 @Trace(operationName = "3-3-11批量查询周期阶段资料by周期")
 @Tags({@Tag(key = "参数",value = "arg[0]"),
 @Tag(key = "返回值",value = "returnedObj")})
  @Override
  @Transactional(rollbackFor=Exception.class)
  public  List<OmsTspeCycleStageData>  batchQueryCycleStageDataByCycleListListByIds(BatchQueryCycleStageDataByCycleListListByIdsReq reqDto) {

        try {
            QueryWrapper<OmsTspeCycleStageData> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            if(reqDto.getCycleList()==null || reqDto.getCycleList().isEmpty()){
                    return new ArrayList<>();
                }
        queryWrapper.in("cycle_id", reqDto.getCycleList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsTspeCycleStageData.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsTspeCycleStageData.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper,likeList,fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap,likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsTspeCycleStageData.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsTspeCycleStageData>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1",e,false);
        }
  }
/**
   * 3-3-11删除周期阶段资料[4214]
   * gen by moon at 10/10/2023, 5:06:17 PM
   */
 @Trace(operationName = "3-3-11删除周期阶段资料")
 @Tags({@Tag(key = "参数",value = "arg[0]"),
 @Tag(key = "返回值",value = "returnedObj")})
  @Override
  @Transactional(rollbackFor=Exception.class)
  public  boolean  deleteCycleStageData(String cycleStageDataId ) {

      return super.removeById(cycleStageDataId);
  }
/**
   * 3-3-11批量查询周期阶段资料By定时任务调度ID[9491]
   * gen by moon at 5/2/2024, 2:41:21 AM
   */
 @Trace(operationName = "3-3-11批量查询周期阶段资料By定时任务调度ID")
 @Tags({@Tag(key = "参数",value = "arg[0]"),
 @Tag(key = "返回值",value = "returnedObj")})
  @Override
  @Transactional(rollbackFor=Exception.class)
  public  List<OmsTspeCycleStageData>  batchQueryCycleStageDataByScheduledTask(BatchQueryCycleStageDataByScheduledTaskReq reqDto) {

        try {
            QueryWrapper<OmsTspeCycleStageData> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            if(reqDto.getCycleStageDataList()==null || reqDto.getCycleStageDataList().isEmpty()){
                    return new ArrayList<>();
                }
        queryWrapper.in("crontab_originator_id", reqDto.getCycleStageDataList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsTspeCycleStageData.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsTspeCycleStageData.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper,likeList,fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap,likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsTspeCycleStageData.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsTspeCycleStageData>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1",e,false);
        }
  }
/**
   * 3-3-11查询周期阶段资料By起止时间列表[9893]
   * gen by moon at 6/29/2024, 4:08:50 AM
   */
 @Trace(operationName = "3-3-11查询周期阶段资料By起止时间列表")
 @Tags({@Tag(key = "参数",value = "arg[0]"),
 @Tag(key = "返回值",value = "returnedObj")})
  @Override
  @Transactional(rollbackFor=Exception.class)
  public  List<OmsTspeCycleStageData>  queryCycleStageDataByStartAndEndTimeList(QueryCycleStageDataByStartAndEndTimeListReq reqDto) {

        try {
            QueryWrapper<OmsTspeCycleStageData> queryWrapper = new QueryWrapper<>();

            if(reqDto.getCycleStartTime()!=null && reqDto.getCycleEndTime()!=null){
                queryWrapper.ge("cycle_start_time",reqDto.getCycleStartTime());
                queryWrapper.le("cycle_end_time",reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }

            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsTspeCycleStageData.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsTspeCycleStageData.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper,likeList,fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap,likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsTspeCycleStageData.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            queryWrapper.orderByDesc("operate_time");
            return ((List<OmsTspeCycleStageData>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1",e,false);
        }
  }
/**
   * 3-3-11批量查询周期阶段资料By归属内容[10141]
   * gen by moon at 8/21/2024, 2:24:08 PM
   */
 @Trace(operationName = "3-3-11批量查询周期阶段资料By归属内容")
 @Tags({@Tag(key = "参数",value = "arg[0]"),
 @Tag(key = "返回值",value = "returnedObj")})
  @Override
  @Transactional(rollbackFor=Exception.class)
  public  List<OmsTspeCycleStageData>  batchQueryCycleStageDataByBelongCont(BatchQueryCycleStageDataByBelongContReq reqDto) {

        try {
            QueryWrapper<OmsTspeCycleStageData> queryWrapper = new QueryWrapper<>();

            if(reqDto.getCycleStageDataList()==null || reqDto.getCycleStageDataList().isEmpty()){
                    return new ArrayList<>();
                }
        queryWrapper.in("belong_to_content_id", reqDto.getCycleStageDataList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsTspeCycleStageData.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsTspeCycleStageData.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper,likeList,fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap,likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsTspeCycleStageData.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsTspeCycleStageData>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1",e,false);
        }
  }
/**
   * 3-3-11查询工作任务汇报资料列表[10223]
   * gen by moon at 9/18/2024, 11:05:08 AM
   */
 @Trace(operationName = "3-3-11查询工作任务汇报资料列表")
 @Tags({@Tag(key = "参数",value = "arg[0]"),
 @Tag(key = "返回值",value = "returnedObj")})
  @Override
  @Transactional(rollbackFor=Exception.class)
  public  List<OmsTspeCycleStageData>  queryWorkTaskReportStageDataList(QueryWorkTaskReportStageDataListReq reqDto) {

        try {
            QueryWrapper<OmsTspeCycleStageData> queryWrapper = new QueryWrapper<>();


            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsTspeCycleStageData.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsTspeCycleStageData.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper,likeList,fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap,likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsTspeCycleStageData.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            queryWrapper.orderByDesc("create_time");
queryWrapper.orderByDesc("operate_time");
            return ((List<OmsTspeCycleStageData>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1",e,false);
        }
  }
/**
   * 3-3-11查询最近可循环周期阶段资料详情by提前汇报（小于等于开始时间大于等于结束时间）[10280]
   * gen by moon at 11/7/2024, 6:16:49 PM
   */
 @Trace(operationName = "3-3-11查询最近可循环周期阶段资料详情by提前汇报（小于等于开始时间大于等于结束时间）")
 @Tags({@Tag(key = "参数",value = "arg[0]"),
 @Tag(key = "返回值",value = "returnedObj")})
  @Override
  @Transactional(rollbackFor=Exception.class)
  public  OmsTspeCycleStageData  queryRecentCycleStadgeDataByAheadDetail(QueryRecentCycleStadgeDataByAheadDetailReq reqDto) {

        try {
         reqDto.setIsValid("FALSE");
            QueryWrapper<OmsTspeCycleStageData> queryWrapper = new QueryWrapper<>();

            // TODO: 2024/11/7
            if(reqDto.getCycleStartTime()!=null && reqDto.getCycleEndTime()!=null){
                queryWrapper.le("cycle_start_time",reqDto.getCycleStartTime());
                queryWrapper.ge("cycle_end_time",reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsTspeCycleStageData> retList = super.list(queryWrapper);
            if(retList!=null && retList.size()>0){
                OmsTspeCycleStageData retData = retList.get(0);

                return retData;
            }
            return null;
      } catch (Exception e) {
          e.printStackTrace();
          throw new BizException("-1",e,false);
            }
  }
/**
   * 3-3-11查询最近可循环周期阶段资料详情by提前汇报（小于开始时间大于结束时间）[10293]
   * gen by moon at 11/7/2024, 6:16:50 PM
   */
 @Trace(operationName = "3-3-11查询最近可循环周期阶段资料详情by提前汇报（小于开始时间大于结束时间）")
 @Tags({@Tag(key = "参数",value = "arg[0]"),
 @Tag(key = "返回值",value = "returnedObj")})
  @Override
  @Transactional(rollbackFor=Exception.class)
  public  OmsTspeCycleStageData  queryRecentCycleStadgeDataSmallBigByAheadDetail(QueryRecentCycleStadgeDataSmallBigByAheadDetailReq reqDto) {

        try {
         reqDto.setIsValid("FALSE");
            QueryWrapper<OmsTspeCycleStageData> queryWrapper = new QueryWrapper<>();

            // TODO: 2024/11/7
            if(reqDto.getCycleStartTime()!=null && reqDto.getCycleEndTime()!=null){
                queryWrapper.lt("cycle_start_time",reqDto.getCycleStartTime());
                queryWrapper.gt("cycle_end_time",reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }

            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsTspeCycleStageData> retList = super.list(queryWrapper);
            if(retList!=null && retList.size()>0){
                OmsTspeCycleStageData retData = retList.get(0);

                return retData;
            }
            return null;
      } catch (Exception e) {
          e.printStackTrace();
          throw new BizException("-1",e,false);
        }
  }
}
